package com.zhonghui.modlules.product.eshopVo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.zhonghui.common.eshopSerializer.BigDecimalSerializer;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;

@TableName("store_product_attr_value")
public class StoreProductAttrValue implements Serializable {
    @TableId
    private Long id;
    @ApiModelProperty("商品ID")
    private Long productId;
    @ApiModelProperty("商品属性索引值 (attr_value|attr_value[|....])")
    private String sku;
    @ApiModelProperty("属性对应的库存")
    private Integer stock;
    @ApiModelProperty("拼团库存属性对应的库存")
    private Integer pinkStock;
    @ApiModelProperty("秒杀库存属性对应的库存")
    private Integer seckillStock;
    @ApiModelProperty("销量")
    private Integer sales;
    @ApiModelProperty("属性金额")
    @JsonSerialize(
            using = BigDecimalSerializer.class
    )
    private BigDecimal price;
    @ApiModelProperty("拼团属性对应的金额")
    @JsonSerialize(
            using = BigDecimalSerializer.class
    )
    private BigDecimal pinkPrice;
    @ApiModelProperty("秒杀属性对应的金额")
    @JsonSerialize(
            using = BigDecimalSerializer.class
    )
    private BigDecimal seckillPrice;
    @ApiModelProperty("属性对应的图片")
    private String image;
    @TableField("`unique`")
    @ApiModelProperty("唯一值")
    private String unique;
    @ApiModelProperty("成本价")
    @JsonSerialize(
            using = BigDecimalSerializer.class
    )
    private BigDecimal cost;
    @ApiModelProperty("商品条码")
    private String barCode;
    @ApiModelProperty("原价")
    private BigDecimal otPrice;
    @ApiModelProperty("重量")
    private BigDecimal weight;
    @ApiModelProperty("体积")
    private BigDecimal volume;
    @ApiModelProperty("一级返佣")
    private BigDecimal brokerage;
    @ApiModelProperty("二级返佣")
    private BigDecimal brokerageTwo;
    @ApiModelProperty("所需多少积分兑换商品")
    private Integer integral;

    public void copy(StoreProductAttrValue source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static StoreProductAttrValue.StoreProductAttrValueBuilder builder() {
        return new StoreProductAttrValue.StoreProductAttrValueBuilder();
    }

    public StoreProductAttrValue(final Long id, final Long productId, final String sku, final Integer stock, final Integer pinkStock, final Integer seckillStock, final Integer sales, final BigDecimal price, final BigDecimal pinkPrice, final BigDecimal seckillPrice, final String image, final String unique, final BigDecimal cost, final String barCode, final BigDecimal otPrice, final BigDecimal weight, final BigDecimal volume, final BigDecimal brokerage, final BigDecimal brokerageTwo, final Integer integral) {
        this.id = id;
        this.productId = productId;
        this.sku = sku;
        this.stock = stock;
        this.pinkStock = pinkStock;
        this.seckillStock = seckillStock;
        this.sales = sales;
        this.price = price;
        this.pinkPrice = pinkPrice;
        this.seckillPrice = seckillPrice;
        this.image = image;
        this.unique = unique;
        this.cost = cost;
        this.barCode = barCode;
        this.otPrice = otPrice;
        this.weight = weight;
        this.volume = volume;
        this.brokerage = brokerage;
        this.brokerageTwo = brokerageTwo;
        this.integral = integral;
    }

    public StoreProductAttrValue() {
    }

    public Long getId() {
        return this.id;
    }

    public Long getProductId() {
        return this.productId;
    }

    public String getSku() {
        return this.sku;
    }

    public Integer getStock() {
        return this.stock;
    }

    public Integer getPinkStock() {
        return this.pinkStock;
    }

    public Integer getSeckillStock() {
        return this.seckillStock;
    }

    public Integer getSales() {
        return this.sales;
    }

    public BigDecimal getPrice() {
        return this.price;
    }

    public BigDecimal getPinkPrice() {
        return this.pinkPrice;
    }

    public BigDecimal getSeckillPrice() {
        return this.seckillPrice;
    }

    public String getImage() {
        return this.image;
    }

    public String getUnique() {
        return this.unique;
    }

    public BigDecimal getCost() {
        return this.cost;
    }

    public String getBarCode() {
        return this.barCode;
    }

    public BigDecimal getOtPrice() {
        return this.otPrice;
    }

    public BigDecimal getWeight() {
        return this.weight;
    }

    public BigDecimal getVolume() {
        return this.volume;
    }

    public BigDecimal getBrokerage() {
        return this.brokerage;
    }

    public BigDecimal getBrokerageTwo() {
        return this.brokerageTwo;
    }

    public Integer getIntegral() {
        return this.integral;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    public void setProductId(final Long productId) {
        this.productId = productId;
    }

    public void setSku(final String sku) {
        this.sku = sku;
    }

    public void setStock(final Integer stock) {
        this.stock = stock;
    }

    public void setPinkStock(final Integer pinkStock) {
        this.pinkStock = pinkStock;
    }

    public void setSeckillStock(final Integer seckillStock) {
        this.seckillStock = seckillStock;
    }

    public void setSales(final Integer sales) {
        this.sales = sales;
    }

    public void setPrice(final BigDecimal price) {
        this.price = price;
    }

    public void setPinkPrice(final BigDecimal pinkPrice) {
        this.pinkPrice = pinkPrice;
    }

    public void setSeckillPrice(final BigDecimal seckillPrice) {
        this.seckillPrice = seckillPrice;
    }

    public void setImage(final String image) {
        this.image = image;
    }

    public void setUnique(final String unique) {
        this.unique = unique;
    }

    public void setCost(final BigDecimal cost) {
        this.cost = cost;
    }

    public void setBarCode(final String barCode) {
        this.barCode = barCode;
    }

    public void setOtPrice(final BigDecimal otPrice) {
        this.otPrice = otPrice;
    }

    public void setWeight(final BigDecimal weight) {
        this.weight = weight;
    }

    public void setVolume(final BigDecimal volume) {
        this.volume = volume;
    }

    public void setBrokerage(final BigDecimal brokerage) {
        this.brokerage = brokerage;
    }

    public void setBrokerageTwo(final BigDecimal brokerageTwo) {
        this.brokerageTwo = brokerageTwo;
    }

    public void setIntegral(final Integer integral) {
        this.integral = integral;
    }

    public static class StoreProductAttrValueBuilder {
        private Long id;
        private Long productId;
        private String sku;
        private Integer stock;
        private Integer pinkStock;
        private Integer seckillStock;
        private Integer sales;
        private BigDecimal price;
        private BigDecimal pinkPrice;
        private BigDecimal seckillPrice;
        private String image;
        private String unique;
        private BigDecimal cost;
        private String barCode;
        private BigDecimal otPrice;
        private BigDecimal weight;
        private BigDecimal volume;
        private BigDecimal brokerage;
        private BigDecimal brokerageTwo;
        private Integer integral;

        StoreProductAttrValueBuilder() {
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder id(final Long id) {
            this.id = id;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder productId(final Long productId) {
            this.productId = productId;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder sku(final String sku) {
            this.sku = sku;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder stock(final Integer stock) {
            this.stock = stock;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder pinkStock(final Integer pinkStock) {
            this.pinkStock = pinkStock;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder seckillStock(final Integer seckillStock) {
            this.seckillStock = seckillStock;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder sales(final Integer sales) {
            this.sales = sales;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder price(final BigDecimal price) {
            this.price = price;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder pinkPrice(final BigDecimal pinkPrice) {
            this.pinkPrice = pinkPrice;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder seckillPrice(final BigDecimal seckillPrice) {
            this.seckillPrice = seckillPrice;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder image(final String image) {
            this.image = image;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder unique(final String unique) {
            this.unique = unique;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder cost(final BigDecimal cost) {
            this.cost = cost;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder barCode(final String barCode) {
            this.barCode = barCode;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder otPrice(final BigDecimal otPrice) {
            this.otPrice = otPrice;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder weight(final BigDecimal weight) {
            this.weight = weight;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder volume(final BigDecimal volume) {
            this.volume = volume;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder brokerage(final BigDecimal brokerage) {
            this.brokerage = brokerage;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder brokerageTwo(final BigDecimal brokerageTwo) {
            this.brokerageTwo = brokerageTwo;
            return this;
        }

        public StoreProductAttrValue.StoreProductAttrValueBuilder integral(final Integer integral) {
            this.integral = integral;
            return this;
        }

        public StoreProductAttrValue build() {
            return new StoreProductAttrValue(this.id, this.productId, this.sku, this.stock, this.pinkStock, this.seckillStock, this.sales, this.price, this.pinkPrice, this.seckillPrice, this.image, this.unique, this.cost, this.barCode, this.otPrice, this.weight, this.volume, this.brokerage, this.brokerageTwo, this.integral);
        }

        public String toString() {
            return "StoreProductAttrValue.StoreProductAttrValueBuilder(id=" + this.id + ", productId=" + this.productId + ", sku=" + this.sku + ", stock=" + this.stock + ", pinkStock=" + this.pinkStock + ", seckillStock=" + this.seckillStock + ", sales=" + this.sales + ", price=" + this.price + ", pinkPrice=" + this.pinkPrice + ", seckillPrice=" + this.seckillPrice + ", image=" + this.image + ", unique=" + this.unique + ", cost=" + this.cost + ", barCode=" + this.barCode + ", otPrice=" + this.otPrice + ", weight=" + this.weight + ", volume=" + this.volume + ", brokerage=" + this.brokerage + ", brokerageTwo=" + this.brokerageTwo + ", integral=" + this.integral + ")";
        }
    }
}

